import Vue from 'vue'
import Router from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(Router)

export default new Router({
    // mode: 'history',
    routes: [
        {
            path: '/home',
            name: 'home',
            component: Home
        },
        {
            path: '/advice',
            name: 'advice',
            // route level code-splitting
            // this generates a separate chunk (about.[hash].js) for this route
            // which is lazy-loaded when the route is visited.
            component: () => import(/* webpackChunkName: "about" */ '../views/advice.vue'),
            meta: {
                keepAlive: true // 需要被缓存
            }
        },
        {
            path: '/receive',
            name: 'receive',
            component: () => import('../views/receive')
        },
        {
            path: '/presonal',
            name: 'presonal',
            component: () => import('../views/presonal')
        },
        {
            path: '/preMak',
            name: 'preMak',
            component: () => import('../views/preMak')
        },
        {
            path: '/addPatient',
            name: 'addPatient',
            component: () => import('../views/addPatient'),
            meta: {
                keepAlive: false // 不需要被缓存
            }
        },
        {
            path: '/',
            name: 'authentication',
            component: () => import('../views/authentication')
        },
        {
            path: '/doctorDetail',
            name: 'doctorDetail',
            component: () => import('../views/doctorDetail'),
            meta: {
                keepAlive: true // 需要被缓存
            }
        },
        {
            path: '/searchPatient',
            name: 'searchPatient',
            component: () => import('../views/searchPatient'),
            meta: {
                keepAlive: true // 需要被缓存
            }
        }, {
            path: '/searchRecord',
            name: 'searchRecord',
            component: () => import('../views/searchRecord'),
            meta: {
                keepAlive: true // 需要被缓存
            }
        },
        {
            path: '/chargesInfo',
            name: 'chargesInfo',
            component: () => import('../views/chargesInfo'),
            meta: {
                keepAlive: false // 不需要被缓存
            }
        },
        {
            path: '/acceptInfo',
            name: 'acceptInfo',
            component: () => import('../views/acceptInfo'),
            meta: {
                keepAlive: true // 需要被缓存
            }
        },

        {
            path: '/addCost',
            name: 'addCost',
            component: () => import('../views/addCost'),
            meta: {
                keepAlive: false // 需要被缓存
            }
        },
        {
            path: '/medicineList',
            name: 'medicineList',
            component: () => import('../views/medicineList'),
            meta: {
                keepAlive: false // 需要被缓存
            }
        },
        {
            path: '/detailPatient',
            name: 'detailPatient',
            component: () => import('../views/detailPatient'),
            meta: {
                keepAlive: false // 需要被缓存
            }
        },
        {
            path: '/searchDiag',
            name: 'searchDiag',
            component: () => import('../views/searchDiag'),
            meta: {
                keepAlive: false // 需要被缓存
            }
        },
        {
            path: '/protocol',
            name: 'protocol',
            component: () => import('../views/protocol.vue')
        },
        {
            path: '/costList',
            name: 'costList',
            component: () => import('../views/costList.vue')
        },
        {
            path: '/profit',
            name: 'profit',
            component: () => import('../views/profit.vue')
        },
        {
            path: '/record',
            name: 'record',
            desc: "病历列表",
            component: () => import('../views/record.vue'),
            meta: {
                keepAlive: true  //暂时不需要缓存
            }
        },
        {
            path: '/recordDetail',
            name: 'recordDetail',
            desc: "病历详情",
            component: () => import('../views/recordDetail.vue'),
            meta: {
                keepAlive: false  //暂时不需要缓存
            }
        }
    ]
})
